// 1588
    public static int sumOddLengthSubarrays(int[] arr) {
        int res=0;
        for(int i=1;i<=arr.length;i+=2){
            int local=0;
            while((local+i)<=arr.length) {
                for (int j = 0; j < i; j++) {
                    res+=arr[local+j];
                }
                local++;
            }
        }
        return res;
    }
